package com.zyf.chapter02.structure.adapter.example2.refactor;

import com.zyf.chapter02.structure.adapter.example2.CSensitiveWordsFilter;

/**
 * B 敏感词过滤系统适配器
 * @author yifeng
 */
public class CSensitiveWordsFilterAdaptor implements ISensitiveWordsFilter{
    private CSensitiveWordsFilter cFilter;
    /**
     * 过滤后的标记
     */
    private String mark;

    public CSensitiveWordsFilterAdaptor(CSensitiveWordsFilter cFilter, String mark) {
        this.cFilter = cFilter;
        this.mark = mark;
    }

    @Override
    public String filter(String text) {
        String maskedText = cFilter.filter(text, mark);
        return maskedText;
    }
}
